<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>我爱大重庆-新闻咨询-添加模块</title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <style>
        /*.container-fluid{*/
            /*margin:10px 20px;*/
            /*border:1px solid #ccc;*/
            /*border-radius: 5px;*/
        /*}*/
        #submit{
            margin-bottom:20px;
        }
    </style>
</head>
<body style="background-image:url(http://public.weirongm.com/DaChongQing//NewsAdmin/images/bg.png);background-position:top center;  background-attachment: fixed;">
<form action="{:U('News/publish')}" enctype="multipart/form-data" method="post">
<div class="container-fluid col-lg-8 col-md-8" style="border-right: 1px solid #FFF">
        <div class="row">
            <div class="col-lg-12 col-md-12 col-xs-12">
                <!--<h3>新闻咨询添加</h3>-->
            </div>
            <div class="col-lg-12 col-md-12 col-xs-12" style="margin-top:20px;">
                <div class="bs-example" data-example-id="basic-forms">

                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                            <label for="title">标题</label>
                            <input type="text" class="form-control" id="title" name="title" placeholder="输入标题，必须填">
                        </div>
                        <!--<div class="form-group col-lg-12 col-md-12 col-xs-12">-->
                            <!--<label for="jianjie">简介</label>-->
                            <!--<input type="text" class="form-control" value="略" id="jianjie" name="details" placeholder="输入简介，必须填">-->
                        <!--</div>-->
                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                            <label for="biaoqian">标签</label>
                            <input type="text" class="form-control" name="biaoqian" id="biaoqian" placeholder="标签，可多添。用%隔开">
                        </div>


                        <div class="form-group col-lg-12 col-md-12 col-xs-12">
                            <label for="content">内容</label>
                            <textarea id="content" name="content"></textarea>
                        </div>


                </div>
            </div>
        </div>
    </div>
    <div class="container-fluid col-lg-4 col-md-4" style="border-right: 1px solid #FFF">
        <div class="form-group col-lg-12 col-md-12 col-xs-12" style="margin-top:20px;">
            <label for="fenlei">选择资讯分类</label><br/>
            <select name="column"  style="width:100%;height: 40px ;border-radius: 5px" id="fenlei">
                <foreach name="column" item="column">
                    <option value="{$column['id']}">{$column['title']}</option>
                </foreach>
            </select>
        </div>
        <div class="form-group col-lg-12 col-md-12 col-xs-12">
            <label for="thumb">缩略图</label>
            <input type="file" class="form-control" name="thumb" id="thumb" placeholder="选择图片，只能选择一张">
        </div>
        <div class="form-group col-lg-12 col-md-12 col-xs-12">
            <label>投票</label>
            <p><button type="button" class="btn btn-danger openvote" style="width: 100%">开启投票</button><br/><br/>
                <input type="text" class="votename form-control" style="display: none" name="vote_title" placeholder="输入投票标题">
            </p>
            <button type="button" id="tp-button" class="btn btn-danger" style="width: 100%">添加投票选项</button>
            <p></p>
            <p id="tp"></p>
            <!--<input type="text" class="form-control" name="toupiao[]" id="toupiao" placeholder="投票内容">-->
        </div>
        <!--<div class="form-group col-lg-12 col-md-12 col-xs-12">-->
            <!--<button type="submit" class="btn btn-success" id="submit" style="width: 100%">确认发表</button>-->
        <!--</div>-->
        </div>
    <div class="form-group col-lg-12 col-md-12 col-xs-12">
        <button type="submit" class="btn btn-success" id="submit" style="margin-bottom:0 !important;margin-top:10px;width: 100%">确认发表</button>
    </div>
</form>
    <script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
    <script src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script>
        window.UEDITOR_HOME_URL = "/ueditor/";
        window.onload = function () {
            window.UEDITOR_CONFIG.initialFrameWidth = '100%';
            window.UEDITOR_CONFIG.initialFrameHeight = 450;
            UE.getEditor('content');
        }
    </script>
<script>
    $(function(){
        $('#tp-button').click(function(){
            var str = '<input type="text" class="form-control" name="toupiao[]" id="toupiao" placeholder="投票内容"><br/>';
            $('#tp').before(str);
        })
        $('.openvote').click(function(){
            $('.votename').show();
        })
    })
</script>
</body>
</html>